import {defineConfig} from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import {resolve} from 'path'

export default defineConfig({
    plugins: [uni()],
    resolve: {
        alias: {
            '@': resolve(__dirname, '.'),
            'uview-plus': resolve(__dirname, 'node_modules/uview-plus')
        }
    },
    css: {
        preprocessorOptions: {
            scss: {
                additionalData: `
          @import "@/uni_modules/uview-plus/theme.scss";
          @import "@/styles/variables.scss";
          @import "@/styles/mixins.scss";
        `
            }
        }
    },
    server: {
        proxy: {
            '/api': {
                target: 'http://192.168.123.40:8080',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, '')
            }
        }
    }
})
